import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/Index'
import IndexUsers from '@/components/IndexUsers'
import IndexClass from '@/components/IndexClass'
import IndexItem from '@/components/IndexItem'
import IndexOutlines from '@/components/IndexOutlines'
import IndexMenus from '@/components/IndexMenus'
import IndexPersonal from '@/components/IndexPersonal'
import IndexPapers from '@/components/IndexPapers'
import IndexMenus1 from '@/components/IndexMenus1'
import Login from '@/components/Login'
import Regist from '@/components/Regist'
import Answer from '@/components/Answer'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/index',
      component:Index,
      redirect:'/index/menus',
      children:[
        {
          path: 'menus',
          component: IndexMenus
        },
        {
          path: 'menus1',
          component: IndexMenus1
        },
        {
          path:'users',
          component: IndexUsers,
        },
        {
          path: 'classes',
          component: IndexClass,
        },
        {
          path: 'item',
          component: IndexItem,
        },
        {
          path: 'outlines',
          component: IndexOutlines,
        },
        {
          path: 'personal',
          component: IndexPersonal,
        },
        {
          path: 'papers',
          component: IndexPapers,
        },
      ],
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/regist',
      component: Regist
    },
    {
      path: '/answer/:id',
      component: Answer,
      props:true,
    },
  ]
})
